package _04_Enum;

public class Enum_02 {
	public static void main(String[] args) {
		int a = 1;
		int b = 2;
		Result retValue = divide(a, b);
		if (retValue.equals(Result.SUCCESS)) {
			System.out.println("成功");
		} else {
			System.out.println("失败");
		}
	}

	public static Result divide(int a, int b) {
		try {
			int c = a / b;
			return Result.SUCCESS;
		} catch (Exception e) {
			return Result.FAIL;
		}
	}
}

enum Result {
	SUCCESS, FAIL
}